<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        button{
            border: 1px solid #ccc;
            background-color: #f0f0f03a;
            cursor: pointer;
        }
        button.clicked{
            background-color: aqua;
            color: rgb(39, 10, 234);
            border: 2px solid plum;
        }
    </style>
</head>
<body>
    <button id="button1">按钮1</button>
    <button id="button2">按钮2</button>
    <button id="button3">按钮3</button>
    <button id="button4">按钮4</button>
    <button id="button5">按钮5</button>

    <script>
        const buttons=document.querySelectorAll('button');
        buttons.forEach(function(button){
            button.addEventListener('click',function(){
                buttons.forEach(function(btn){
                    btn.classList.remove('clicked');
                });
                this.classList.add('clicked');
            });
        });
    </script>
</body>
</html>